//@ sourceURL=RelatedPartyForm.js
RelatedPartyForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        RelatedPartyForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "相关方管理添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/relatedparty/saveRelatedParty.do",
                items:[
                       {
                           id : "relatedParty.id",
                           name : "relatedParty.id",
                           xtype : "hidden",
                           value : this.id == null ? "": this.id
                       }, {
                           name : "relatedParty.years",
                           xtype : "hidden",
                           id : "relatedParty.years",
                           value : this.years == null ? "" : this.years
                       },{
                           layout:"column",
                           bodyStyle:"padding:5px;",
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               defaultType:"textfield",
                               border:false,
                               columnWidth:0.5,
                               items:[{
                                   fieldLabel: '所属机构', 
                                   name: 'relatedParty.institution'
                               }]
                       },{
                          layout:"form",
                          columnWidth:.5,
                          border:false,
                          bodyStyle:"padding:5px;",
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:'公司名称'+'<font color=red>*</font>',
                              id:"relatedParty.companyName",
                              name:"relatedParty.companyName",
                             // maxLength:80,
                              allowBlank:false,
                              blankText:"公司名称不能为空！"
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"公司联系电话",
                              id:"relatedParty.companyTelephone",
                              name:"relatedParty.companyTelephone",
                           /*  // regex: (\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14},
                              mobilephone:function(val,field)    
                              {    
                                    try    
                                    {    
                                        if(/(^0?[1][35][0-9]{9}$)/.test(val))    
                                            return true; 
                                        return false;
                                        }
                                    }    
                                    catch(e)    
                                    {    
                                        return false;    
                                    }    
                              },   
                              mobilephoneText:'请输入正确的手机号码',*/  
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"负责人姓名",
                              id:"relatedParty.responPerson",
                              name:"relatedParty.responPerson",
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:1.,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"公司地址",
                              id:"relatedParty.companyPlace",
                              name:"relatedParty.companyPlace",
                             // maxLength:80,
                              width:448 ,
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:1.,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"负责人电话",
                              id:"relatedParty.responTelephone",
                              name:"relatedParty.responTelephone",
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      }]
                       },{
                   layout:"column",
                   bodyStyle:"padding:5px;",
                   items:[{
                       columnWidth:1.,//第一列 
                       layout:"form", 
                       bodyStyle:"padding:5px;",
                       items:[{ 
                           xtype:"textarea", 
                           fieldLabel: '公司简介(业务范围)', 
                           name: 'relatedParty.companyProfile', 
                           width:448 
                           }] 
                  },{
                      columnWidth:1.,//第一列 
                      layout:"form", 
                      bodyStyle:"padding:5px;",
                      items:[{ 
                          xtype:"textarea", 
                          fieldLabel: '备注', 
                          name: 'relatedParty.remark', 
                          width:448 
                          }] 
                 }]
               }]
            },
        loadData:{
            getUrl:__ctxPath +"/relatedparty/getRelatedParty.do",
            preName : "relatedParty"
        },
        isShow:this.isShow
    });
}
});
